#include <stdio.h>
long long A=1992919, B=18181971;
FILE *f;
char s[20];
int ts=1;
int next()
{
	A=(A*13166771+B)%1000000007;
	B=(B*67771+A)%1000000007;
	return A;
}
void createtest() { sprintf(s, "%03d", ts); ts++; f=fopen(s, "w"); }
void gen0()
{
	createtest();
	fprintf(f, "1 1 1\n");
	createtest();
	fprintf(f, "1 2 3\n");
	createtest();
	fprintf(f, "1 1 2\n");
	createtest();
	fprintf(f, "1 1 1000\n");
	createtest();
	fprintf(f, "1 1000 1000\n");
	createtest();
	fprintf(f, "1000 1000 1000\n");
	createtest();
	fprintf(f, "1 30 1000\n");
}
void gen1()
{
	createtest();
	fprintf(f, "%d %d %d\n", next()%1000+1, next()%1000+1, next()%1000+1);
}
int main()
{
	int i;
	gen0();
	for(i=0; i<20; i++)
		gen1();
	return 0;
}